package com.nchu.commondevelopmentframework.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

/**
 * @className: LoginUserDTO
 * @description: UserDetails下实现类
 * @author: Li Chuanwei
 * @date: 2024/02/06 21:31
 * @Company: Copyright [日期] by [作者或个人]
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class LoginUserDTO implements UserDetails{
    private Long id;

    private String username;

    private String password;
    private String nickName;

    private Collection<? extends GrantedAuthority> authorities;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return authorities;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
